<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <hello-world :num='num'></hello-world>
    </div>

    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
        Vue.component('hello-world',{
            data:function(){
                return {
                    msg:10,
                }
            },
            props:['num'],
            template:`
                <div>  
                    <h2>我是子组件的值 ：{{msg}}</h2>
                    <h2>我是子组件拿到父组件的值：{{num}}</h2>
                </div>
            `
        });

        new Vue({
            el:'#app',
            data:function() {
                return {
                    num:100,
                }
            }
        })
    </script>
</body>
</html>